//大作业H3

const int ledPin = 2;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(ledPin,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available() > 0) {
    char value = Serial.read();
    if (value == 'Y' || value == 'y') {
      digitalWrite(ledPin,HIGH);
    }
    if (value == 'N' || value == 'n') {
      digitalWrite(ledPin,LOW);
    }
  }
  delay(200);
}
